#include<stdio.h>

int outl(int n) {
    int i;
    for (i = 1; i < n; i++) {
        printf("%2d", i);
    }
    if (n == 10) printf(" 0");
    else printf("%2d", n);
    for (i = i - 1; i > 0; i--) {
        printf("%2d", i);
    }
    return 0;
}

int kongg(int n, int i) {
    int k;
    for (k = 1; k <= (n - i); k++) {
        printf("  ");
    }
    return 0;
}

int main() {
    int n, i;
    int out;
    scanf_s("%d", &n);
    for (i = 1; i <= n; i++) {
        out = kongg(n, i);
        out = outl(i);
        if (i < n)printf("\n");
    }
    return 0;
}
